<template>
	<view>
		<water-mask></water-mask>
		<uv-toast ref="toast"></uv-toast>
		<uni-forms :labelWidth = '80' style="margin: 0.5rem">
			<uni-forms-item label="来客单位" name="org">
				<uni-easyinput v-model="form.org" placeholder="请输入来客单位" />
			</uni-forms-item>
			<uni-forms-item label="来客事由" name="reason">
				<uni-easyinput v-model="form.reason" placeholder="请输入事由" />
			</uni-forms-item>
			<uni-forms-item label="来客人数" name="peopleNum">
				<uni-easyinput v-model="form.peopleNum" placeholder="请输入来客人数" />
			</uni-forms-item>
			<uni-forms-item label="申请人" name="applicant">
				<uni-easyinput v-model="form.applicant" placeholder="请输入申请人" />
			</uni-forms-item>
			<uni-forms-item label="就餐日期" name="mealTime">
				<uni-datetime-picker v-model="form.mealTime" type="datetime" value-format="yyyy-MM-dd"
					placeholder="请选择就餐日期">
				</uni-datetime-picker>
			</uni-forms-item>
		</uni-forms>
		<view class="button">
			<button type="primary" style="width: 10rem" @click="add">提交申请</button>
		</view>
	</view>
</template>

<script>
	import { listMeal, getMeal, delMeal, addMeal, updateMeal } from "@/api/system/meal";
	export default {
		data() {
			return {
				form: {
					org: null,
					reason: null,
					peopleNum: null,
					applicant: null,
					mealTime: null,
					createBy: null,
					createTime: null,
					updateBy: null,
					updateTime: null,
					remark: null
				},
			};
		},
		methods:{
		add(){
	
			addMeal(this.form).then(res=>{
				this.$refs.toast.show({	type: 'success',
						title: '成功主题(带图标)',
						message: "提交申请成功"});
			})
		},	
		}
	}
</script>

<style lang="scss">

</style>